home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 65.zip / BS1 part 65 / Math Visin v2.1 disk 2.adf / Arexx.CLI / KleinZoom.rexx < prev    next >
OS/2 REXX Batch file  |  1992-02-14  |  3KB  |  99 lines

  1. /* ZOOM.REXX, an ARexx program for MathVision, 3-Sep-89 dh */
  2.  
  3. /*============================== User Settings =============================*/
  4. NUMERIC DIGITS 15
  5.  
  6. Pictures = 50            /* Number of pictures to plot */
  7. StartPicture = 0        /* Picture to start plotting with */
  8. BaseFilename = "Mandelbrot_Zoom:Pic"    /* Basic pathname for pictures */
  9.  
  10. xcenter0   = 0                  /* coordinates of starting (big) picture */
  11. xwidth0    = 4
  12. ycenter0   = 0.00001
  13. ywidth0    = 3
  14.  
  15. xcenter1   = -.73695        /* coordinates of ending (small) picture */
  16. xwidth1    = 0.0005
  17. ycenter1   = .2014
  18. ywidth1    = .0004
  19.  
  20. /*==========================================================================
  21.  
  22.   This generic Arexx program will allow you to create a series of zoomed
  23. pictures in contour plot mode.  It is assumed that you have already entered
  24. the appropriate functions, colors and setting in MathVision.
  25. It takes into account the fact that as you zoom in closer, you must use
  26. smaller increments.
  27.  
  28.   To use this program, you must edit this file, and put in the appropriate
  29. values in the User Settings section which follows. 
  30.  
  31.   The 'BaseFilename' is the basic name which will be used for all the pictures.
  32. For example, if you put "PLOTS:PIC", the files will be named "PLOTS:PIC0000",
  33. "PLOTS:PIC0001", "PLOTS:PIC0002", and so on.  The number of the picture is 
  34. appended to the basic file name.
  35.  
  36.   'Pictures' is how many frames you want in this zoom.  A higher setting
  37. here will give you smoother animation.  The pictures will be numbered starting
  38. at 0 and going up to Pictures-1.
  39.  
  40.   'StartPicture' is useful if your plotting has to be restarted because of
  41. some interrupt, like a Drastic Power Failure or Real Work.  Just plug in the
  42. number of the next picture to plot, and it will start right there.  Normally
  43. this value is 0.  This lets you work on your computer during the day, and
  44. resume the plotting during the night.
  45.  
  46.   You must give the starting and ending coordinates of your zoom.  These 
  47. are given in the variables xmin_start, xmin_end, and etc. 
  48.  
  49. ============================================================================*/
  50.    
  51. ADDRESS "MathVision"        
  52. OPTIONS RESULTS            /* We need answers */
  53. OPTIONS FAILAT 1        /* everything is fatal */
  54. SIGNAL ON ERROR            /* if error, goto ERROR: */
  55.  
  56. xfactor = xwidth1/xwidth0
  57. yfactor = ywidth1/ywidth0
  58.  
  59. DO PictureNumber = StartPicture TO Pictures-1        /* for each picture...*/
  60.  
  61.   Filename = BaseFilename||Right(PictureNumber,4,"0")    /* status report */
  62.   SAY "Plotting: "Filename
  63.  
  64.   mult = (PictureNumber) / (Pictures-1)        /* 0..1 */
  65.  
  66.   xmag = power(xfactor,mult)
  67.   ymag = power(yfactor,mult)
  68.   xwidth = xwidth0*xmag
  69.   ywidth = ywidth0*ymag
  70.   xcenter = xcenter0+((xcenter1-xcenter0)*(xmag-1) / (xfactor-1) )
  71.   ycenter = ycenter0+((ycenter1-ycenter0)*(ymag-1) / (yfactor-1) )
  72.  
  73.   Xmin xcenter-xwidth/2        /* plug in the new values */
  74.   Xmax xcenter+xwidth/2
  75.   Ymin ycenter-ywidth/2
  76.   Ymax ycenter+ywidth/2
  77.  
  78.   PlotContour             /* do the appropriate plot */
  79.  
  80.   Pathname Filename        /* set the name for this file */
  81.   SavePicture             /* save it to disk */
  82.  
  83.   Get StopSign
  84.   IF Result = "T" THEN BREAK
  85. END /* do */
  86. EXIT
  87.   
  88. /*------------------------------- functions ------------------------------- */
  89.  
  90. power:            /* number to power */
  91.   arg base, pow
  92.   Get Eval base"^"pow    /* kick DMA to evaluate this */
  93.   return(result)
  94.  
  95. ERROR:            /* Error Diagnostic for return codes */
  96.   Get Diagnosis RC
  97.   SAY RESULT" on line "SIGL
  98.   EXIT
  99.